/**
 * @author v.lugovsky
 * created on 16.12.2015
 */
(function () {
    'use strict';

    angular.module('BlurAdmin.pages.class', [])
        .config(routeConfig);

    /** @ngInject */
    function routeConfig($stateProvider, $urlRouterProvider) {
        $stateProvider
            .state('class', {
                url: '/class',
                template : '<ui-view  autoscroll="true" autoscroll-body-top></ui-view>',
                abstract: true,
                title: '班级',
                sidebarMeta: {
                    icon: 'fa fa-users',
                    order: 300,
                },
            }).state('class.list', {
                url: '/list',
                templateUrl: 'app/pages/class/list/class-list.html',
                controller: 'ClassListCtrl as vm',
                title: '班级列表',
                sidebarMeta: {
                    order: 0,
                }
            }).state('class.manage', {
                url: '/manage/{id:string}',
                templateUrl: 'app/pages/class/list/class-manage.html',
                controller: 'ClassManageCtrl as vm',
                title: '班级详情',
                resolve: {
                    id: function($stateParams){
                        return $stateParams.id;
                    }
                }
            }).state('class.save', {
                url: '/save/{id:string}',
                templateUrl: 'app/pages/class/list/class-saveManage.html',
                controller: 'ClassSaveManageCtrl as vm',
                title: '修改班级详情',
                resolve: {
                    id: function($stateParams){
                        return $stateParams.id;
                    }
                }
            });
        $urlRouterProvider.when('/class','/class/list');
    }

})();
